/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    font-size: 14px;
    color: #333;
    background-color: #f9f9f9;
}

.popup-container {
    width: 400px;
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: hidden;
}

/* 头部样式 */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
}

.header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.header-actions {
    display: flex;
    align-items: center;
}

.settings-btn {
    background: none;
    border: none;
    cursor: pointer;
    margin-right: 10px;
    font-size: 16px;
    color: #666;
    transition: color 0.2s;
}

.settings-btn:hover {
    color: #2196F3;
}

.close-btn {
    background: none;
    border: none;
    font-size: 18px;
    color: #666;
    cursor: pointer;
    transition: color 0.2s;
}

.close-btn:hover {
    color: #f44336;
}

/* 内容区域样式 */
.content {
    padding: 15px;
}

/* 文件信息样式 */
.file-info {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
}

.file-icon {
    width: 36px;
    height: 36px;
    margin-right: 12px;
    object-fit: contain;
}

.file-details {
    flex: 1;
    overflow: hidden;
}

.file-name {
    font-weight: 600;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-size {
    color: #666;
    font-size: 12px;
}

/* 警告和错误消息样式 */
.safety-warning {
    padding: 10px 12px;
    background: #FFF3E0;
    border-left: 4px solid #FF9800;
    margin: 10px 0;
    font-size: 12px;
    display: none;
    border-radius: 4px;
}

.error-message {
    padding: 10px 12px;
    background: #FFEBEE;
    border-left: 4px solid #F44336;
    margin: 10px 0;
    font-size: 12px;
    display: none;
    border-radius: 4px;
}

/* 进度条样式 */
.progress-container {
    margin: 15px 0;
    display: none;
}

.progress-bar {
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: #4CAF50;
    width: 0%;
    transition: width 0.3s;
}

.progress-text {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #666;
    margin-top: 5px;
}

/* 表单字段样式 */
.field {
    margin-bottom: 12px;
}

.field label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #555;
}

.field input[type="text"] {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
}

.field input[type="text"]:focus {
    border-color: #2196F3;
    outline: none;
    box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.2);
}

.save-location {
    display: flex;
    gap: 8px;
}

.save-location input {
    flex: 1;
}

.save-location button {
    white-space: nowrap;
    padding: 8px 12px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.save-location button:hover {
    background: #e0e0e0;
}

/* 下载按钮样式 */
.download-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 15px 0;
}

.download-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s;
}

.download-btn:hover {
    background: #f5f5f5;
    border-color: #aaa;
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.download-btn:active {
    transform: translateY(0);
}

.download-btn img {
    width: 28px;
    height: 28px;
    margin-bottom: 8px;
    object-fit: contain;
}

.download-btn span {
    font-size: 12px;
    font-weight: 500;
}

.download-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.download-btn:disabled:hover {
    background: #fff;
    border-color: #ddd;
    transform: none;
    box-shadow: none;
}

/* 操作按钮样式 */
.action-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 15px;
}

.action-buttons button {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

#openBtn {
    background-color: #2196F3;
    color: white;
}

#openBtn:hover {
    background-color: #1976D2;
}

#openFolderBtn {
    background-color: #4CAF50;
    color: white;
}

#openFolderBtn:hover {
    background-color: #388E3C;
}

#cancelBtn {
    background-color: #f5f5f5;
    color: #333;
}

#cancelBtn:hover {
    background-color: #e0e0e0;
}

/* 响应式调整 */
@media (max-width: 420px) {
    .popup-container {
        width: 100%;
        border-radius: 0;
    }
    
    .download-buttons {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .action-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    .action-buttons button {
        width: 100%;
    }
}